import Toast from 'tdesign-miniprogram/toast/index';
import { shopCardata } from '../../../../services/config/api';
import { request } from '../../../../services/_utils/util';

const shortageImg = 'https://cdn-we-retail.ym.tencent.com/miniapp/cart/shortage.png';
Page({
  data: {
    userId: wx.getStorageSync('userInfo').id,
    shortageImg,
    isShowSpecs: false,
    currentGoods: {},
    isShowToggle: false,
    shopCardata: [],
    _invalidGoodItems: [],
  },
  onShow() {
    this.getshopCar();
    console.log(123);
  },
  getshopCar() {
    if (userId == null || userId == undefined) {
      this.setData({
        shopCardata: [],
      });
    } else {
      request(shopCardata + '?userId=' + this.data.userId).then((res) => {
        console.log(res);
      });
    }
  },
});
